package com.example.admin.repository;

import com.example.admin.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface UserRepository extends JpaRepository<User, Long>, JpaSpecificationExecutor<User> {
    List<User> findByName(String name);

    @Query(value = "select *  from base_admins where id>0", nativeQuery = true)
    List<Object> getBasicList();

    User findByPhone(String phone);

    Optional<User> findById(Long id);


}
